<?php
/*
$JA#COPYRIGHT$
*/


defined('_JEXEC') or die('Retricted Access');
if (! class_exists ( 'JAStack' )&&! class_exists ( 'SmartTrim' ))
	require_once(JPATH_SITE.DS.'components'.DS.'com_jajobboard'.DS.'helper'.DS.'jahelper.php');
global $jbconfig, $option;  

if( empty($this->all_items) )
	return ;

$show_counter 		= intval( $params->get("show_counter", 1) );

$rows 		= intval( $params->get("cols", 1) );
if( $rows < 1 )
	$rows = 1;
$limitPerRows 	= count($this->all_items)/$rows;

if( $params->get("cols", 1) > 0){
?>
<table class="jajobscounter_table"><tr>
<?php
	for($i=0; $i<$rows; $i++){
		$limit = $limitPerRows*($i+1);
		?>
		<td>
			<ul class="jajobscounter_cols">
			<?php
			for ($j= ($limitPerRows*$i); $j< $limitPerRows*($i+1); $j++ ){
				if ( !isset($this->all_items[$j]) )
					continue;
				$item = $this->all_items[$j];
				?>
				<li> <a href="<?php echo JRoute::_('index.php?option=com_jajobboard&view=jajobs&layout=filter_job_list&Itemid='.$this->Itemid.'&'.$item->field.'='.$item->text)?>"><?php echo $item->text?></a><?php if($show_counter){?> (<?php echo $item->num;?>) <?php }?></li>
				<?php
			}
			?>
			</ul>
		</td>
		<?php
	}
?>
</tr></table>
<?php }else { echo " "; } ?>